package com.test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

import com.guo.hui.dao.redis.Member;
import com.guo.hui.dao.redis.MemberDao;
import com.guo.hui.dao.redis.RedisCacheUtil;
import com.guo.hui.dao.redis.RedisUtil;

@ContextConfiguration(locations = { "classpath:spring-mybatis.xml", "classpath:spring-redis.xml" })
public class UnitRedis extends AbstractJUnit4SpringContextTests {
	// @Autowired
	// private MemberDao memberDao;
	// @Autowired
	// private RedisUtil redisUtil;

	@Test
	public void test() {
		System.out.println(RedisCacheUtil.get("namse"));
//		RedisCacheUtil.set("password", "ss");
		// RedisUtil.setTime("password", null, 30, new TimeUnit());
		// System.out.println(RedisCacheUtil.get("username"));
		// System.out.println(RedisCacheUtil.get("password"));
	}

	@Test
	public void testRedis() {
		// Member mm = new Member();
		// mm.setId("username");
		// mm.setName("guohui");
		// mm.setTime(30);
		// memberDao.add(mm);
		// memberDao.checktime("username");
		// memberDao.add(mm);
		// System.out.println(memberDao.get("username"));
		// redisUtil.setValue("name", "guohui");
		// System.out.println(RedisUtil.get("name"));
		// RedisUtil.set("password", "ss");
		//// RedisUtil.setTime("password", null, 30, new TimeUnit());
		// System.out.println(RedisUtil.get("username"));
		// System.out.println(RedisUtil.get("password"));
	}

}
